﻿using MovieBrowser.Model;

namespace MovieBrowser.Util
{
    public class Authorization
    {
        public static Authorization Instance { get; private set; }

        public static User LoggedInUser { get; set; }
        public static bool IsAuthorized { get { return LoggedInUser != null; } }

        private Authorization(User user)
        {
            LoggedInUser = user;
        }

        public static Authorization CreateInstance(User user)
        {
            return Instance ?? (Instance = new Authorization(user));
        }
    }
}